const userService = require('./../service/userService.js');
 
var getUserInfo = (ctx, next) => {
  let query = ctx.query;
  let userId = query.id;
  let userInfo = userService.getUserById(userId);
 
  let html = '<html><body>'
    + '<div> userinfo: ' + userInfo + '</div>'
    + '</body></html>';
  ctx.response.type ='text/html';
  ctx.response.body = html;
};
 
var saveUserInfo = (ctx, next) => {
  const requestString = ctx.data;
  //TODO数据处理
  console.log(requestString);
};
 
module.exports = {
  getUserInfo : getUserInfo,
  saveUserInfo : saveUserInfo
};